<template>
  <div class="clinicManagement-container">
    <div class="leftSidebar-container">
      <left-sidebar :datas="list" @update-view="updateView"></left-sidebar>
    </div>
    <div class="centerView-container">
      <router-view v-if="isRouterAlive"></router-view>
<!--      <router-view />-->
    </div>
  </div>
</template>
<script>
  import leftSidebar from "@/components/leftSidebar";

  export default {
    name: "templates",
    components: { leftSidebar },
    data() {
      return {
        list: [
          {
            title: "诊所信息",
            iconType: "iconFont",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "iconfont icon-menzhen",
              path: "/clinicManagement/registerInfo",
          },
          {
            title: "人员管理",
            iconType: "iconFont",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "iconfont icon-renyuanguanli",
              path: "/clinicManagement/personnelManagement",
          },
          {
            title: "科室管理",
            iconType: "iconFont",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "iconfont icon-keshiguanli",
              path: "/clinicManagement/departmentManagement",
          },
          {
            title: "检查与治疗项设置",
            iconType: "iconFont",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "iconfont icon-yishengduanzhiliaoxiangmu",
              path: "/clinicManagement/checkSetting",
          },
          {
            title: "附加费用",
            iconType: "iconFont",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "iconfont icon-fujiafeiyong3x",
              path: "/clinicManagement/surcharge",
          },
          {
            title: "挂号费设置",
            iconType: "iconFont",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "iconfont icon-menzhenshoufei",
              path: "/clinicManagement/registrationFeeSetting",
          },
          {
            title: "系统设置",
            iconType: "iconFont",
            pic: {
              defaultIcon: require("../../assets/img/public/default-avatar.jpg"),
              icon: require("../../assets/img/public/default-avatar.jpg"),
            },
            iconFont: "iconfont icon-iconset0177",
              path: "/clinicManagement/systemSetting",
          },
        ],
        isRouterAlive: true
      };
    },
    methods: {
      reload () {
        this.isRouterAlive = false;
        this.$nextTick(function () {
          this.isRouterAlive = true
        })
      },
      updateView: function () {
        this.reload()
        // if (this.$refs["routerView"].updateApi) {
        //   this.$refs["routerView"].updateApi();
        // }
      },
    }
  };
</script>
<style lang="scss" scoped>
  @import "@/assets/scss/clinicManagement/clinicManagement.scss";
</style>
